Website Hosting
By bigspotteddog
What is GitHub Pages?
GitHub Pages is a free hosting option offered by GitHub. You can add your custom domain and GitHub provides the SSL certificate for free as well.
1. Set up a GitHub account
To begin, sign up for a GitHub account (if you don't already have one) at https://github.com.
2. Add a new repository
Next, add a new repository to your GitHub account.
- Set the repository name
- Add a description
- Make the visibility Private
- Add a README
3. Add your website files
- Click Add file
- Click Upload files
4. Select your website files
5. Drag and drop your files
Drag and drop your files into the GitHub add files dialog.
6. Commit your files to complete the upload
- Scroll to the bottom of the upload files page
- Enter a commit message (ex. "Add website files")
- Click the Commit changes button
7. Go to the Settings page for your repository
On your website's repository page, click the Settings button.
8. Go to Pages
On the repository settings page, click Pages.
9. Set up Pages for your website
- Select branch main
- Click Save
Your site is automatically assigned to:
https://<your github username>.github.io/<repository name>
10. Add your custom domain
If you have your own custom domain, go to your DNS server and configure an CNAME record for your domain (ex. blog.example.com) and give it this value:
.github.io
I use AWS so mine looks like this.
11. Add your custom domain to GitHub Pages
- Enter your custom domain
- Click Save
- Your website will be running at http://<your custom domain> initially.
- You will need to wait while GitHub validates your domain then creates your SSL certificate to enable HTTPS.
12. Enable HTTPS
Once your domain is validated, you can enable Enforce HTTPS.
Now your website is running securely on https://<your custom domain>.
All done.